#ifndef __CONSUMERTHREAD_H_
#define __CONSUMERTHREAD_H_

#include "TaskQueue.hpp"
#include "Thread.hpp"
#include <stdio.h>

namespace pc{

class ConsumerThread
:public Thread{
public:
    ConsumerThread(TaskQueue & q)
    :_taskQue(q)
    {

    }

private:
    void run() override{
        int cnt = 20;
        while(cnt-- > 0){
            int tmp = _taskQue.pop();

            printf("consumer num : %d\n",tmp);
        }
    }

private:
    TaskQueue & _taskQue;
};


}//end of namespace pc


#endif

